home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 648 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.3 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: tjb839@zacatecas.optimum.com (Tim Boemker)
  3. Newsgroups: comp.std.c++
  4. Subject: possible extension -- typeof(expr)
  5. Date: 6 Mar 1996 18:13:40 GMT
  6. Organization: ?
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <199603061757.AA17403@zacatecas.optimum.com>
  9. NNTP-Posting-Host: taumet.eng.sun.com
  10. Content-Type: text
  11. X-Authenticated: tjb839 on POP host zacatecas.optimum.com
  12. X-Mailed-From: InterNews 1.0.6@boemker.optimum.com
  13. Content-Length: 431
  14. X-Lines: 15
  15. Originator: clamage@taumet
  16.  
  17. Many times in working with STL I've wished for a new operator to return
  18. the type of an expression, much the same way sizeof returns the size of
  19. an expression.
  20.  
  21. It would allow programs like the following, for example:
  22.  
  23.    set<foo, less<foo> > s;
  24.    for(typeof(s)::iterator i = s.begin(); i != s.end(); i++)
  25.       // do something
  26.  
  27. I suppose this must have been considered by now.  Has anything come of
  28. it?
  29.  
  30. Tim Boemker
  31. Optimum Group
  32.  
  33.  
  34. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your
  35.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  36.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  37.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  38.   Comments? mailto:std-c++-request@ncar.ucar.edu
  39. ]
  40.